Public Class NOrientacion
    Public Function CargarOrientacion(ByVal Orient As Entidades.EOrientacion) As Boolean
        'utiliza la capa de datos
        Dim oDatos As New Datos.DOrientacion
        Dim oOrientaciones As New List(Of Entidades.EOrientacion)
        Dim band As Boolean
        Try
            oOrientaciones = oDatos.buscarOrientacion(Orient)
            If oOrientaciones.Count > 0 Then
                Throw New ArgumentException("Ese nombre de orientacion ya fue cargada. Cargue otro diferente o vaya a modificar.")
            End If
            band = oDatos.CargarOrientacion(Orient)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function

    Public Function modificarOrientacion(ByVal orient As Entidades.EOrientacion) As Boolean
        Dim oDatos As New Datos.DOrientacion
        Dim band As Boolean
        Try
            band = oDatos.ModificarOrientacion(orient)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function

    Public Function buscarOrientacion(ByVal orient As Entidades.EOrientacion, ByVal cond As Boolean) As List(Of Entidades.EOrientacion)

        Dim oDatos As New Datos.DOrientacion
        Try
            Return oDatos.buscarOrientacion(orient, cond)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    Public Function buscarOrientacion(ByVal orient As Entidades.EOrientacion) As List(Of Entidades.EOrientacion)
        'utiliza la capa de datos
        Dim oDatos As New Datos.DOrientacion
        Try
            Return oDatos.buscarOrientacion(orient)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function


    Public Function buscarOrientacion(ByVal orient As String) As Integer
        'utiliza la capa de datos
        Dim oDatos As New Datos.DOrientacion
        Try
            Return oDatos.buscarOrientacion(orient)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    Public Function buscarOrientacion(ByVal curso As Entidades.ECurso) As Entidades.EOrientacion
        'utiliza la capa de datos
        Dim oDatos As New Datos.DOrientacion
        Try
            Return oDatos.buscarOrientacion(curso)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    'sobrecargado
    Public Function buscarOrientaciones(ByVal cond As Boolean) As List(Of Entidades.EOrientacion)
        'utiliza la capa de datos
        Dim oDatos As New Datos.DOrientacion
        Try
            Return oDatos.buscarOrientaciones(cond)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    Public Function buscarOrientaciones() As List(Of Entidades.EOrientacion)
        'utiliza la capa de datos
        Dim oDatos As New Datos.DOrientacion
        Try
            Return oDatos.buscarOrientaciones()
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    Public Function generarProximoCodigo() As Integer
        Dim oDatos As New Datos.DOrientacion
        Dim codigo As Integer
        Try
            codigo = oDatos.traerProximoCodigo()
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        End Try
        Return codigo
    End Function
    Public Function traerCodigoOrientacion(ByVal orientacion As String) As Integer
        Dim odatos As New Datos.DOrientacion
        Try
            Return odatos.traerCodigoOrientacion(orientacion)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            odatos = Nothing
        End Try
    End Function

End Class
